package ru.mipt.victator.pagerank;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;

public class Value implements Writable
{

	public Text source;
	public IntWritable N;
	
	public Value()
	{
		this.source = null;
		this.N = null;
	}
	
	public Value(Text _source)
	{
		this.source = _source;
	}

	public Value(Text _source, IntWritable _N)
	{
		this.source = _source;
		this.N = _N;
	}
	
	@Override
	public void readFields(DataInput in) throws IOException
	{
		source = new Text();
		source.readFields(in);
		N = new IntWritable();
		N.readFields(in);
	}

	@Override
	public void write(DataOutput out) throws IOException
	{
		this.source.write(out);
		this.N.write(out);
	}
}
